package cronjob

import (
	"gitee/yinlai/kms-backend/controllers/cronjob"
	"github.com/gin-gonic/gin"
)

// 实现添加集群
func create(cronjobGroup *gin.RouterGroup) {
	cronjobGroup.POST("/create", cronjob.Create)
}

// 更新集群
func update(cronjobGroup *gin.RouterGroup) {
	cronjobGroup.POST("/update", cronjob.Update)
}

// 删除
func delete(cronjobGroup *gin.RouterGroup) {
	cronjobGroup.POST("/delete", cronjob.Delete)
}

// 删除列表
func deleteList(cronjobGroup *gin.RouterGroup) {
	cronjobGroup.POST("/deleteList", cronjob.DeleteList)
}

// 获取
func get(cronjobGroup *gin.RouterGroup) {
	cronjobGroup.GET("/get", cronjob.Get)
}

// 获取集群列表
func list(cronjobGroup *gin.RouterGroup) {
	cronjobGroup.GET("/list", cronjob.List)
}

func RegisterSubRouter(g *gin.RouterGroup) {
	cronjobGroup := g.Group("/cronjob")
	create(cronjobGroup)
	update(cronjobGroup)
	delete(cronjobGroup)
	get(cronjobGroup)
	list(cronjobGroup)
	deleteList(cronjobGroup)
}
